﻿<base:BaseForm x:Class="PictureManager.WPF.frmMaintenance"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:base="clr-namespace:Infrastructure.UI.WPF;assembly=Infrastructure.UI.WPF"
    xmlns:data="clr-namespace:PictureManager.Core;assembly=PictureManager.Core"
         xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
    Title="frmMaintenance" Height="800" Width="600">
    <Window.Resources>
        <Style TargetType="Label">
            <Style.Triggers>
                <EventTrigger RoutedEvent="MouseEnter">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation  Duration="0:0:1" To="Red" Storyboard.TargetProperty="Background.(SolidColorBrush.Color)">
                            </ColorAnimation>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="MouseLeave">
                    <BeginStoryboard>
                        <Storyboard>
                            <ColorAnimation Duration="0:0:1"  From="Red" Storyboard.TargetProperty="Background.(SolidColorBrush.Color)">
                                
                            </ColorAnimation>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Style.Triggers>
        </Style>
        <Style TargetType="Image">
            <Style.Triggers>
                <EventTrigger RoutedEvent="MouseEnter">
                    <BeginStoryboard>
                        <Storyboard >
                            <DoubleAnimation To="200" Duration="0:0:0.5" 
                                             Storyboard.TargetProperty="Width" >
                            </DoubleAnimation>
                            <DoubleAnimation To="200" Duration="0:0:0.5" 
                                             Storyboard.TargetProperty="Height" />
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <EventTrigger RoutedEvent="MouseLeave">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation From="200" Duration="0:0:0" 
                                             Storyboard.TargetProperty="Width" />
                            <DoubleAnimation From="200" Duration="0:0:0" 
                                             Storyboard.TargetProperty="Height" />
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Effect">
                        <Setter.Value>
                            <DropShadowEffect BlurRadius="100" Color="Red" 
                          Direction="20" Opacity="0.9"/>
                        </Setter.Value>
                    </Setter>
                    
                </Trigger>

            </Style.Triggers>
        </Style>
    </Window.Resources>



    <Grid Name="grpMain">
        <Grid.RowDefinitions>
            <RowDefinition Height="75*" />
            <RowDefinition Height="20*" />
            <RowDefinition Height="687*" />
            <RowDefinition Height="10" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="2*" />
        </Grid.ColumnDefinitions>

        <TreeView Name="treeViewPicture" AllowDrop="True" Grid.RowSpan="3" Margin="2,2" >
            <TreeView.ContextMenu>
                <ContextMenu >
                    <TextBlock  Name="meuLoad" Text="Load" >
                    </TextBlock>
                </ContextMenu>
            </TreeView.ContextMenu>
            
        </TreeView>
        <GridSplitter Grid.Column="1" Grid.RowSpan="2" HorizontalAlignment="Right" 
                  VerticalAlignment="Stretch"  ResizeBehavior="PreviousAndNext"
                  Width="2" Background="Brown" />
        <Grid Grid.Column="2" Name="grpDetail" Margin="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="70" />
                <ColumnDefinition Width="159*" />
                <ColumnDefinition Width="119*" />
                <ColumnDefinition Width="9*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="23" />
                <RowDefinition Height="23" />
                <RowDefinition Height="23" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Label Content="Name" VerticalAlignment="Center"  Grid.Row="0" ></Label>
            <TextBox VerticalAlignment="Center" Grid.Column="1" Grid.Row="0" Name="txtName" Text="{Binding Name}"  Margin="2,2" />
            <CheckBox Grid.Column="2" Name="chkShowPathColumn" Margin="5" Content="Show Path Column" 
                      HorizontalAlignment="Center" VerticalAlignment="Center"  
                      Checked="chkShowPathColumn_Checked" Unchecked="chkShowPathColumn_Unchecked" />
            <Label Content="Path" VerticalAlignment="Center" Grid.Row="1" ></Label>
            <TextBox VerticalAlignment="Center" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1"  Name="txtPath" Text="{Binding Path}" Margin="2,2"/>
            <Label Content="Description" VerticalAlignment="Center" Grid.Row="2"></Label>
            <TextBox VerticalAlignment="Center" Grid.Column="1"  Grid.ColumnSpan="2" Grid.Row="2" Name="txtDesc" Text="{Binding Desc}" Margin="2,2"/>

        </Grid>
        <Border  Grid.Column="2" Grid.Row="1" Background="Violet" 
              HorizontalAlignment="Stretch"
              VerticalAlignment="Stretch" >
            <Border.Triggers>
                <EventTrigger RoutedEvent="Border.MouseLeftButtonDown">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames 
        Storyboard.TargetName="transformObj"
        Storyboard.TargetProperty="X"
        Duration="0:0:15">
                                    <SplineDoubleKeyFrame Value="500" KeyTime="0:0:3" KeySpline="0.0,0.1 0.1,0.1" />
                                    <SplineDoubleKeyFrame Value="50" KeyTime="0:0:7" KeySpline="0.0,0.1 0.1,0.1"/>
                                    <SplineDoubleKeyFrame Value="300" KeyTime="0:0:13" KeySpline="0.0,0.1 0.1,0.1"/>

                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </Border.Triggers>
            <Border.RenderTransform>
                <TranslateTransform x:Name="transformObj" X="0" Y="0" />
            </Border.RenderTransform>
        </Border>
        <ScrollViewer Grid.Column="2" Grid.Row="2">
            <WrapPanel Name="grpPicture"></WrapPanel>
        </ScrollViewer>
        <ProgressBar Grid.Row="3" Grid.ColumnSpan="3" Name="progressBar1" VerticalAlignment="Stretch" Visibility="Hidden" />
    </Grid>
</base:BaseForm>
